home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / Quill / Source / ValidatorEditor.h < prev    next >
Text File  |  1997-07-27  |  2KB  |  90 lines

  1. /*
  2.  *  File:       ValidatorEditor.h
  3.  *  Summary:       A view that knows how to edit a TTextBox's validator.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->    11/30/96    JDJ        Created
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <ZControl.h>
  17. #include <ZListener.h>
  18. #include <ZTextBox.h>
  19.  
  20. #include "BasePaneEditor.h"
  21.  
  22.  
  23. //-----------------------------------
  24. //    Forward References
  25. //
  26. class TTextBox;
  27. class TTextValidator;
  28.  
  29.  
  30. // ===================================================================================
  31. //    CValidatorEditor
  32. // ===================================================================================
  33. class CValidatorEditor : public CRootPaneEditor, public MListener<SControlMessage> {
  34.  
  35.     typedef CRootPaneEditor Inherited;
  36.     
  37. //-----------------------------------
  38. //    Initialization/Destruction
  39. //
  40. public:
  41.     virtual                ~CValidatorEditor();
  42.                         
  43.                         CValidatorEditor(TView* superView);
  44.  
  45. //-----------------------------------
  46. //    CBaseEditor API
  47. //
  48. public:
  49.     virtual void         SetPane(TPane* pane);
  50.     
  51.     virtual bool         Validate();
  52.  
  53.     virtual void         Apply();
  54.     
  55.     virtual void         Commit(TMultipleUndoableCommand* command);
  56.  
  57.     virtual void         Revert();
  58.  
  59. //-----------------------------------
  60. //    MListener API
  61. //
  62. protected:
  63.     virtual void         OnBroadcast(const SControlMessage& mesg);
  64.  
  65. //-----------------------------------
  66. //    TReanimator Support
  67. //
  68. public:
  69.     static     MReanimatable* Create(MReanimatable* parent);
  70.  
  71. //-----------------------------------
  72. //    Internal API
  73. //
  74. protected:
  75.             TTextValidatorPtr GetEditorInfo() const;
  76.             
  77.             void         SetEditorInfo(TTextValidatorPtr info);
  78.             
  79.             void         SetPaneInfo(TTextValidatorPtr info);
  80.             
  81. //-----------------------------------
  82. //    Member data
  83. //
  84. protected:
  85.     TTextBox*            mPane;
  86.     TTextValidatorPtr    mOldInfo;
  87. };
  88.  
  89.  
  90.